#include "settings.h"
#include "ui_settings.h"

Settings::Settings(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::Settings)
{
    ui->setupUi(this);

    QSettings settings(CONFIG_FILE, QSettings::IniFormat);
    ui->mdAklineEdit->setText(settings.value("tmdb/apikey").toString());
}

Settings::~Settings()
{
    delete ui;
}

void Settings::accept()
{
    QSettings settings(CONFIG_FILE, QSettings::IniFormat);
    settings.setValue("tmdb/apikey", ui->mdAklineEdit->text());
    QDialog::accept();
}
